angular.module('layoutRouter', ['ui.router'])
    .config(function ($stateProvider, $urlRouterProvider) {
        $urlRouterProvider.otherwise("index");
        $stateProvider
            .state('/', {
                url: '/',
                views: {
                    '': {templateUrl: TPLROOT + 'public/body.html'},
                    'header@/': {templateUrl: TPLROOT + 'public/header.html'},
                    'main@/': {templateUrl: TPLROOT + 'public/main.html'},
                    'left@/': {templateUrl: TPLROOT + 'index.html'},
                    'right@/': {templateUrl: TPLROOT + 'public/nav_list.html'}
                }
            })
            .state('/.index', {
                url: 'index',
                views: {'main@/': {templateUrl: TPLROOT + 'index.html'}}
            })
            .state('/.user', {
                url: 'user',
                views: {'left@/': {templateUrl: TPLROOT + 'user/index.html'}}
            })
            .state('/.user.add', {
                url: '/add/:id',
                views: {'left@/': {templateUrl: TPLROOT + 'user/add.html', controller:'userAdd'}}
            })
            .state('/.system', {
                url: 'system',
                views: {'left@/': {templateUrl: TPLROOT + 'system/index.html', controller: 'setSystem'}}
            })
            .state('login', {
                url :'/login',
                templateUrl: TPLROOT + 'public/login.html'
            })
            .state('/.advertising',{
                url :'advertising',
                views:{'left@/':{templateUrl:TPLROOT+'system/advertising.html'}}
            })
            .state('/.advertising.add',{
                url :'advertising/add',
                views:{'left@/':{templateUrl:TPLROOT+'system/advertising_add.html'}}
            });;

    });

